package utils;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class DB {
	
	public static Connection getConnection(){
		
		Connection con = null;
		
		try {
			Class.forName("com.mysql.jdbc.Driver");
			
			con = DriverManager.getConnection("jdbc:mysql://localhost:3306/test","root","123456");
			
		} catch (ClassNotFoundException e) {
			System.out.println("驱动异常：" + e.getMessage());
		} catch (SQLException e) {
			System.out.println("拿连接异常：" + e.getMessage());
		}
		
		return con;
		
	}	
}
